#include <iostream>
#include <Eigen/Dense>
#include<limits>
#include "MatrixOperations.h"
using namespace std;



void clearScreen(){
    #ifdef _WIN32
        system("cls");
    #else
        system("clear");
    #endif
    
}
void pauseScreen(){
    cout<<"按回车键继续"<<endl;
    cin.ignore();
    cin.get();
}

void MainMenu(){
        int choice;
        
        do{
            cout<<"===矩阵运算器==="<<endl;
            cout<<"/[1]矩阵创建"<<endl;
            cout<<"1.创建自定义矩阵"<<endl;
            cout<<"2.初始化特殊矩阵"<<endl;
            cout<<"3.查看所有创建的矩阵"<<endl;
            cout<<"/[2]矩阵运算"<<endl;
            cout<<"4.矩阵加法（A+B）"<<endl;
            cout<<"5.矩阵减法（A-B）"<<endl;
            cout<<"6.矩阵与标量数乘(k*A)"<<endl;
            cout<<"7.矩阵与矩阵乘法(A*B)"<<endl;
            cout<<"8.矩阵转置(A^T)"<<endl;
            cout<<"/[3]矩阵属性"<<endl;
            cout<<"9.获取矩阵尺寸"<<endl;
            cout<<"10.判断矩阵是否为空"<<endl;
            cout<<"11.退出矩阵运算器"<<endl;

            cout<<endl;
            cout<<"请选择功能:"<<endl;

            choice=getCorrectChoice();
            switch(choice){
                case 1:{
                    clearScreen();
                    CreateMatrix();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();

                    break;
                }
                case 2:{
                    clearScreen();
                    CreateSpecialMatrixMenu();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();
                    break;
                }
                case 3:{
                    clearScreen();
                    DisplayCreatedMatrixs();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();

                    break;
                }
                case 4:{
                    clearScreen();
                    addMatrix();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();
                    break;
                }
                case 5:{
                    clearScreen();
                    subMatrix();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();
                    break;
                }
                case 6:{
                    clearScreen();
                    scalarMulMatrix();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();
                    break;
                }
                case 7:{
                    clearScreen();
                    mulMatrix();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();
                    break;
                }
                case 8:{
                    clearScreen();
                    TransposeMatrix();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();
                    break;
                }
                case 9:{
                    clearScreen();
                    GetMatrixSize();
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();
                    break;
                }
                case 10:{
                    clearScreen();
                    IsMatrixEmpty();
                    
                    pauseScreen();
                    clearScreen();
                    cout<<"继续选择："<<endl;
                    pauseScreen();


                    break;
                }
                case 11:{
                    cout<<"按任意键退出。。。"<<endl;
                    pauseScreen();
                
                    return;
                }
                default:

                    cout<<"选择无效，重新输入："<<endl;
                    pauseScreen();
                    break;
                
            }
        }while(true);


}
int main(){
    MainMenu();

   
}